package xpn.platform.modules.todo.donelink;

import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.data.rest.core.config.Projection;
import xpn.platform.common.repository.XpnRepository;
import xpn.platform.modules.sys.user.SysUser;

import java.util.Date;

/**
 * 已办 Dao
 *
 * @author duwei
 */
@RepositoryRestResource(path = "done_link", excerptProjection = DoneLinkProjection.class)
public interface DoneLinkDAO extends XpnRepository<DoneLink, Long> {
    /**
     * 根据业务Id查询已办
     *
     * @param taskId
     * @return
     */
    @RestResource(exported = false)
    DoneLink findByTaskId(@Param("taskId") String taskId);

}


@Projection(name = "default", types = {DoneLink.class})
interface DoneLinkProjection {

    Long getId();

    String getTaskId();

    String getLinkUrl();

    String getType();

    String getSubject();

    String getCreatorId();

    String getCreatorName();

    String getCreatorOrgName();

    String getSenderId();

    String getSenderName();

    String getSendeeId();

    String getCategory();

    Date getSentTime();

    String getEmergency();
}